// Magic Software, Inc.
// http://www.magic-software.com
// Copyright (c) 2000, All Rights Reserved
//
// Source code from Magic Software is supplied under the terms of a license
// agreement and may not be copied or disclosed except in accordance with the
// terms of that agreement.  The various license agreements may be found at
// the Magic Software web site.  This file is subject to the license
//
// RESTRICTED USE SOURCE CODE
// http://www.magic-software.com/License/restricted.pdf

#ifndef MGCRENDERSTATE_H
#define MGCRENDERSTATE_H

#include "MgcController.h"
#include "MgcObject.h"
#include "MgcRenderState.mcr"
MgcSmartPointer(MgcRenderState);


class MgcRenderState : public MgcObject
{
    MgcDeclareRTTI;
    MgcDeclareStream;

public:
    // supported render states
    enum Type
    {
        RS_ALPHA,
        RS_DITHER,
        RS_FOG,
        RS_LIGHT,
        RS_MATERIAL,
        RS_SHADE,
        RS_TEXTURE,
        RS_VERTEXCOLOR,
        RS_WIREFRAME,
        RS_ZBUFFER,
        RS_MAX_STATE
    };

    enum { RS_QUANTITY = RS_MAX_STATE*sizeof(MgcRenderState*) };

    virtual Type GetType () const = 0;
    virtual void Update (MgcRenderState*& rpkOldState);
    virtual void Restore (MgcRenderState* pkOldState);
    virtual MgcRenderState* Copy ();

    class List
    {
    public:
        MgcRenderStatePtr m_spkState;
        List* m_pkNext;
    };

    static MgcRenderState** GetDefaultStates () { return ms_apkDefault; }

protected:
    // abstract base class
    MgcRenderState ();
    virtual ~MgcRenderState ();

    // default states
    static MgcRenderState* ms_apkDefault[RS_MAX_STATE];
};

MgcRegisterStream(MgcRenderState);

#endif
